var express = require('express')
var router = express.Router()
const MainController = require('../controller/mainController')

/* GET users listing. */
router.get('/', function (req, res, next) {
  res.send('respond with a resource')
})

//登录接口
router.post('/login', MainController.login)
//模糊分页查询用户列表接口
router.get('/userList', MainController.getUserList)
//删除用户接口
router.delete('/deleteUserById', MainController.deleteUserById)
//根据用户id修改用户的信息
router.put('/updateUserById', MainController.updateUserById)
//根据用户id修改用户的信息
router.get('/getUserById', MainController.getUserById)
//添加用户
router.post('/createUser', MainController.createUser)
//根据用户id修改用户密码
router.put('/updatePassword', MainController.updatePassword)
//根据用户编码获得用户
router.get('/getUserByUserCode', MainController.getUserByUserCode)
//根据用户名获得用户
router.get('/getUserByUserName', MainController.getUserByUserName)
//根据电话获得用户
router.get('/getUserByPhone', MainController.getUserByPhone)
module.exports = router
